const conversionData = (time) => {
  var chinaStandard = time
  var date = new Date(chinaStandard);
  var y = date.getFullYear();
  var m = date.getMonth() + 1;
  m = m < 10 ? ('0' + m) : m;
  var d = date.getDate();
  d = d < 10 ? ('0' + d) : d;
  let times = y + '-' + m + '-' + d;  //年 月 日
  return times
}

const generateRandomNumbers = (n, minNum, maxNum) => {
  const numbers = new Set();
  while (numbers.size < n) {
    const num = Math.floor(Math.random() * (maxNum - minNum + 1)) + minNum;
    numbers.add(num);
  }
  return Array.from(numbers);
}

module.exports = {
  conversionData,
  generateRandomNumbers
}